namespace Yaaf.Wp7.AdvancedExplorer
{
    using System.Resources;

    using Microsoft.Phone.Shell;

    public static class AppMenuTranslatior
    {
        public static void TranslateAppMenu(IApplicationBar applicationBar, ResourceManager resourceManager)
        {
            for (int i=0; i < applicationBar.MenuItems.Count;i++)
            {
                var current = (ApplicationBarMenuItem)applicationBar.MenuItems[i];
                current.Text = resourceManager.GetString(current.Text);
            }

            for (int i = 0; i < applicationBar.Buttons.Count; i++)
            {
                var current = (ApplicationBarIconButton)applicationBar.Buttons[i];
                current.Text = resourceManager.GetString(current.Text);
            }
        }
    }
}